// 订单

import request from '@/utils/request'

// 加入购物车
export function addCarts(data) {
  return request({
    url: 'https://elm.cangdu.org/v1/carts/checkout',
    method: 'POST',
    data
  })
}

// 下单
export function submit(data) {
  return request({
    url: `https://elm.cangdu.org/v1/users/${data.user_id}/carts/${data.cart_id}/orders`,
    method: 'POST',
    data
  })
}

// 获取备注信息
export function getRemarks(cart_id) {
  return request({
    url: `/v1/carts/${cart_id}/remarks`,
    method: 'GET'
  })
}
